package com.centaline.androidsalesblog.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.centaline.androidsalesblog.base.BaseFragment;

import java.util.ArrayList;

/**
 * 禁止手动滑动的PagerAdapter
 * Created by guilin on 16/2/15.
 */
public class IndexFragmentAdapter extends FragmentPagerAdapter {

    private final ArrayList<BaseFragment> fragmentArrayList;

    public IndexFragmentAdapter(FragmentManager fm, ArrayList<BaseFragment> fragmentArrayList) {
        super(fm);
        this.fragmentArrayList = fragmentArrayList;
    }

    @Override
    public int getCount() {
        return fragmentArrayList.size();
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentArrayList.get(position);
    }

}
